﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Text;

namespace DomainModel.Entities
{
    [Table(Name = "QuestionnaireEntries")]
    public class QuestionnaireEntry
    {
        [Column(Name = "question_entriesID", IsPrimaryKey = true, IsDbGenerated = true, AutoSync = AutoSync.OnInsert)]
        public int QuestionnaireEntryID { get; set; }

        [Column(Name = "jobsID")]
        public int JobID { get; set; }
        [Column(Name = "questionID")]
        public int QuestionID { get; set; }

        [Association(OtherKey = "QuestionEntryID")]
        private EntitySet<AnsweredQuestion> _answeredQuestions = new EntitySet<AnsweredQuestion>();
        public IList<AnsweredQuestion> AnsweredQuestions { get { return _answeredQuestions.ToList().AsReadOnly(); } }
    }
}
